<?php 
// +----------------------------------------------------------------------
// | ThinkSNS
// +----------------------------------------------------------------------
// | Copyright (c) 2009 http://www.thinksns.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: nonant <nonant@thinksns.com>
// +----------------------------------------------------------------------
// 

class RecordModel extends Model{
	
	
	function getData($map,$limit=20){
		$list = $this->where($map)->order("id DESC")->findpage($limit);
		foreach ($list['data'] as $key=>$val){
			$list['data'][$key]['comment'] = W('Comment',array('type'=>'record','admin'=>$val['uid'],'fid'=>$val['id']),true);
		}
		return $list;
	}
	
	function getNewData($uid){
		return $this->where("uid=$uid")->field('uid,content,cTime')->order("id DESC")->find();
	}
	

}
?>